import VueRouter from 'vue-router'

// 导入对应的路由
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MembreContainer from './components/tabbar/MembreContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopCarContainer from './components/tabbar/ShopCarContainer.vue'
import NewsList from './page/news/NewsList.vue'
import NewsInfo from './page/news/NewsInfo.vue'
import PhotoList from './page/photos/PhotoList.vue'
import PhotoInfo from './page/photos/PhotoInfo.vue'
import GoodsList from './page/goods/GoodsList.vue'
import GoodsInfo from './page/goods/GoodsInfo.vue'
import GoodsDesc from './page/goods/GoodsDesc.vue'
import GoodsComment from './page/goods/GoodsComment.vue'

// 3. 创建路由对象
var router=new VueRouter({
  routes:[
    {path:'/',redirect:'/home'},
    {path:'/home',component:HomeContainer},
    {path:'/member',component:MembreContainer},
    {path:'/search',component:SearchContainer},
    {path:'/shopcar',component:ShopCarContainer},
    {path:'/home/newslist',component:NewsList},
    // {path:'/home/newsinfo/:id',component:NewsInfo},
    {path:'/home/newsinfo/',component:NewsInfo},
    {path:'/home/photolist/',component:PhotoList},
    {path:'/home/photoinfo/',component:PhotoInfo},
    {path:'/home/goodslist/',component:GoodsList},
    // {path:'/home/goodsinfo/:id',component:GoodsInfo},
    {path:'/home/goodsinfo/',component:GoodsInfo,name:'goodsinfo'},
    // {path:'/home/goodsdesc/:id',component:GoodsDesc,name:'goodsdesc'},
    // {path:'/home/goodscomment/:id',component:GoodsComment,name:'goodscomment'},
    {path:'/home/goodsdesc/',component:GoodsDesc,name:'goodsdesc'},
    {path:'/home/goodscomment/',component:GoodsComment,name:'goodscomment'},
  ],
  linkActiveClass:'mui-active'
})

// 把路由对象暴露出去
export default router